{-# LANGUAGE CPP                        #-}
{-# LANGUAGE ForeignFunctionInterface   #-}
{-# OPTIONS -Wall #-}


--------------------------------------------------------------------------------
-- |
-- Module      :  Lambola.Foreign.Java.BasicTypes
-- Copyright   :  (c) Stephen Tetley 2014
-- License     :  BSD3
--
-- Maintainer  :  Stephen Tetley <stephen.tetley@gmail.com>
-- Stability   :  highly unstable
-- Portability :  GHC
--
-- Basic types.
--
--------------------------------------------------------------------------------

module Lambola.Foreign.Java.BasicTypes where

#include <jni.h>

-- TODO / jbyte, jint and jlong are machine dependent...


import qualified Foreign.C.Types  as Hs
import qualified Foreign.Ptr      as Hs

type JBoolean   = Hs.CUChar

type JByte      = Hs.CSChar

type JChar      = Hs.CUShort

type JShort     = Hs.CShort

type JInt       = Hs.CLong

type JLong      = Hs.CLLong     --- help....

type JFloat     = Hs.CFloat

type JDouble    = Hs.CDouble

type JSize      = JInt

newtype JavaVM  = JavaVM (Hs.Ptr ())

newtype JNIEnv = JNIEnv (Hs.Ptr ())


newtype JObject = JObject (Hs.Ptr ())

type JClass     = JObject
type JThrowable = JObject
type JString    = JObject
type JArray     = JObject


